package com.mystudy.concurrent.designModel.contextModel;

/**
 * todo: 执行上下文
 *
 * @Author acy
 * @Date 2019/05/29
 */
public final class ActionContext {
	private static final ThreadLocal<MyContext> threadLocal = ThreadLocal.withInitial(MyContext::new);

	public MyContext getMyContext() {
		return threadLocal.get();
	}

	private static class ContextHolder{
		private static final ActionContext actionContext=new ActionContext();
	}

	public static ActionContext getActionContext(){
		return ContextHolder.actionContext;
	}

}
